/** 
 * Copyright 2010 Erlacher Felix, Estgfaeller Wolfgang, Ferula Patrick
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package at.socialconference.app;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import at.socialconference.app.model.AConference;

public class ConferenceTabActivity extends TabActivity {
	public TabHost tabHost;  

	private AConference con;
	public void onCreate(Bundle savedInstanceState) {  
		
		Bundle b = getIntent().getExtras();
		con = (AConference)b.getParcelable("conference");
		Bundle bun = new Bundle();
		bun.putParcelable("conference", con); 
		
		super.onCreate(savedInstanceState);  
		setContentView(R.layout.conference_tab_layout);

		this.tabHost = getTabHost();  

		TabHost.TabSpec spec;  
		Intent intent; 
 

		
		intent = new Intent().setClass(this, ConferenceActivity.class);  
		intent.putExtras(bun);
		spec = tabHost.newTabSpec("Conference").setIndicator("Conference",null).setContent(intent);
		tabHost.addTab(spec);  

		intent = new Intent().setClass(this, TalkListActivity.class);
		intent.putExtras(bun);
		spec = tabHost.newTabSpec("Talks").setIndicator("Talks",null).setContent(intent);
		tabHost.addTab(spec);
		
		intent = new Intent().setClass(this, ConferenceTwitterActivity.class);
		intent.putExtras(bun);
		spec = tabHost.newTabSpec("Twitter").setIndicator("Twitter",null).setContent(intent);
		tabHost.addTab(spec);  

		intent = new Intent().setClass(this, PlaceActivity.class);
		bun = new Bundle();
		bun.putParcelable("place", con.getPlace());
		intent.putExtras(bun);
		spec = tabHost.newTabSpec("Place").setIndicator("Place",null).setContent(intent);
		tabHost.addTab(spec);  
		
		tabHost.setCurrentTab(0);  
	}  
}
